<?php
/**
 *
 *  
 * Date: 2024/1/12
 * Email: < >
 */


namespace process;

use app\api\controller\GameBowlController;
use Workerman\Crontab\Crontab;


class GameBowlTask
{
    public function onWorkerStart()
    {
        // 每天的7点30执行，注意这里省略了秒位
//        new Crontab('30 7 * * *', function () {
//            $GameBowlController = new GameBowlController();
//            $GameBowlController->add();
//        });
//        // 每天的9点30执行，注意这里省略了秒位
//        new Crontab('30 21 * * *', function () {
//            $GameBowlController = new GameBowlController();
//            $GameBowlController->openGame();
//        });
//        new Crontab('0 */19 * * * *', function () {
//            $GameCarController = new GameCarController();
//            $GameCarController->openGame();
//        });

        new Crontab('0 */5 * * * *', function () {
            $GameBowlController = new GameBowlController();
            $GameBowlController->add();
            sleep(290);
            $GameBowlController->openGame();
        });

    }
}